package com.bt7274.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户考核规则表：记录考核规则
 * </p>
 *
 * @author hp
 * @since 2025-03-25
 */
@Data
@TableName("user_rule")
public class UserRule implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    /**
     * 考核名称
     */
    private String name;

    /**
     * 考核指标
     */
    private String metric;

    /**
     * 达标阈值
     */
    private float threshold;

    /**
     * 考核周期
     */
    private Integer cycleDays;

    /**
     * 未达标惩罚
     */
    private String penalty;

    private Integer isActive = 1;  // 是否启用（默认1）
    private Integer priority = 100; // 优先级（越小越高）
    private String exemptGroups;   // 豁免的权限组（逗号分隔）
    private String description;    // 规则描述
    private LocalDateTime createdTime;
    private LocalDateTime updatedTime;

    @Override
    public String toString() {
        return "UserRule{" +
        "id = " + id +
        ", name = " + name +
        ", metric = " + metric +
        ", threshold = " + threshold +
        ", cycleDays = " + cycleDays +
        ", penalty = " + penalty +
        "}";
    }
}
